#include <iostream>
#include<cstdio>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>

void sigcb(int sigt)
{
    std::cout << "进行自定义处理，id为：" << sigt << std::endl;
}



int main()
{
    struct sigaction sa,oldsa;
     sa.sa_handler =sigcb;
     sigemptyset(&sa.sa_mask);
    for (int i = 1; i < 32; i++)
        sigaction(i,&sa,&oldsa);

    while (1)
    {
        printf("hello world,pid:%d\n", getpid());
        sleep(1);
    }

    return 0;
}